<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
 <h:head></h:head>
 <h:body>
    <ui:composition template="/WEB-INF/templates/template-outsystem.xhtml">
       <ui:define name="content-title">
           <h1>#{msgs["main.page-title"]}</h1>
       </ui:define>
        
        <ui:define name="content">

            <div class="prelogin-messages">
                <p>
                    <c:choose>
                    <c:when test="#{userManager.loggedIn == true}">
                        <p>
                            #{msgs["main.already-logged-in"]}
                        </p>

                        <p>
                            #{msgs["main.text1"]}
                        </p>
                        
                     <h:form>
                         <h:commandLink id="logoutLoginMenuLogout" action="#{userManager.logout}" styleClass="logout">
                            <h:graphicImage library="images/btn-big/#{facesContext.externalContext.requestLocale.language}/" name="btn-big-logout.png" />
                         </h:commandLink>
                     </h:form>
                    </c:when>
                        <c:otherwise>
                            <p>
                                #{msgs["main.not-logged-in"]}
                            </p>

                            <p>
                                 #{msgs["main.text2"]}
                            </p>

                            <a href="register.jsf">
                                <h:graphicImage library="images/btn-big/#{facesContext.externalContext.requestLocale.language}/" name="btn-big-register.png" />
                            </a>

                            <p>
                                #{msgs["main.text3"]}
                            </p>

                            <a href="user/main.jsf">
                                <h:graphicImage library="images/btn-big/#{facesContext.externalContext.requestLocale.language}/" name="btn-big-login.png" />
                            </a>
                        </c:otherwise>
                    </c:choose>
                </p>
            </div>

            <div style="float:left; width: 45%;">
                <h2>#{msgs["main.welcome-text-title"]}</h2>
                <p>
                    #{msgs["main.welcome-text"]}
                </p>

                <h2>#{msgs["main.welcome-text1-title"]}</h2>
                <p>
                    #{msgs["main.welcome-text1"]}
                </p>

                <h2>#{msgs["main.welcome-text2-title"]}</h2>
                <p>
                    #{msgs["main.welcome-text2"]}
                </p>
            </div>
            
            <hr class="cleaner" />
            
       </ui:define>
    </ui:composition>

</h:body>
</html>
